package com.dbz.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dbz.dao.ProductTypeDao;
import com.dbz.entity.ProductType;
import com.dbz.service.ProductService;
import com.dbz.service.ProductTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

@Service
public class ProductTypeServiceImpl implements ProductTypeService {
    @Resource
    private ProductTypeDao productTypeDao;

    @Override
    public List<ProductType> getProductTypeAll() {
        return productTypeDao.selectList(null);
    }

    @Override
    public IPage<ProductType> selectPage(IPage<ProductType> page, Wrapper<ProductType> queryMapper) {
        return productTypeDao.selectPage(page, queryMapper);
    }

    @Override
    public int insertProType(String protypename) {
        return productTypeDao.insertProType(protypename);
    }

    @Override
    public int updateProType(Integer protypeid,String protypename) {
        return productTypeDao.updateProType(protypeid,protypename);
    }

    @Override
    public int deleteProType(Integer protypeid) {
        return productTypeDao.deleteProType(protypeid);}
    public Set<ProductType> selectproType() {
        return productTypeDao.selectproType();

    }
}
